//package com.zhaopin.countdownlatch;
//
//import java.util.concurrent.CountDownLatch;
//
///**
// * @author yin.peide
// * @date 2021-05-07 17:17
// */
//public class Driver {
//
//    void main() throws InterruptedException {
//        CountDownLatch startSignal = new CountDownLatch(1);
//        CountDownLatch doneSignal = new CountDownLatch(N);
//
//        for (int i = 0; i < N; ++i) // create and start threads
//            new Thread(new Worker(startSignal, doneSignal)).start();
//
//        doSomethingElse();            // don't let run yet
//        startSignal.countDown();      // let all threads proceed
//        doSomethingElse();
//        doneSignal.await();           // wait for all to finish
//    }
//}
